package com.shoeshopping.filter.zx;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
import com.shoeshopping.utils.zx.HttpSessionUtil;
import com.shoeshopping.utils.zx.Result;

public class AdminInterceptor extends MethodFilterInterceptor{

	@Override
	protected String doIntercept(ActionInvocation arg0) throws Exception {
		
		System.out.println("AdminInterceptor");
		
		String adminId = HttpSessionUtil.shareHttpSessionUtil().getAdminId();
		
		if(adminId == null){
			System.out.println("AdminInterceptor : adminId is null , return logintimeout");
			return Result.LOGINTIMEOUT;
		}
		
		return arg0.invoke();
	}

}
